package com.zhongshengnetwork.rightbe.game.model;

import android.util.Log;

import com.zhongshengnetwork.rightbe.CustomApplication;

/**
 * Created by luojingxing on 2018/6/26.
 */

public class GameCommonUtils {
    // 金币计算
    public static int getGoldByLevel(int playlevel) {
        int goldcount = 10;
        if (playlevel > 0) {
            goldcount += (playlevel / 10) * 5;
        }
        if (goldcount > 500) {
            goldcount = 500;
        }
        return goldcount;
    }

    //获取提示
    public static String getTip(String answer, int index, int playlevel, int goldcount){
        if (System.currentTimeMillis()- CustomApplication.getTipTime < CustomApplication.getTipGasTime){
            return "";
        }
        CustomApplication.getTipTime = System.currentTimeMillis();
        if (getGoldByLevel(playlevel) <= goldcount){
            return answer.substring(index, index+1);
        }else {
            return "金币不足";
        }
    }

}
